package com.example.dayday.mapper;

import com.example.dayday.pojo.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Helen
 * @since 2022-09-07
 */
@Mapper
public interface StudentMapper extends BaseMapper<Student> {
@Insert("<script>" +
        " insert into  student (student_id,class_id,id_card,student_name,is_delete,sex\n" +
        "        ,password,phone) values"
+"  <foreach collection=\"list\" item=\"item\" index=\"index\" separator=\",\">"+
" (\n" +
        "        #{item.student_id} ,\n" +
        "            #{item.class_id} ,\n" +
        "            #{item.id_card},\n" +
        "            #{item.student_name},\n" +
        "            #{item.is_delete} ,\n" +
        "            #{item.sex} ,\n" +
        "            #{item.password} ,\n" +
        "            #{item.phone})"+"</foreach></script>")
     void addStudent(Student student);

}
